import hashlib
import json
import random
import requests

# requested_urls = set()
# urls= [f'http://httpbin.org/get?value={random.randint(1,10)}' for i in range(10)]
# for url in urls:
#     if url not in requested_urls:
#         requested_urls.add(url)
#         res = requests.get(url)
#         print(res.json())
#     else:
#         print('改地址请求过了， 不要再次请求')
#



url= 'http://httpbin.org/post?'
datas = [{"id":101,"value":random.randint(1,10)} for i in range(10)]
requested_datas = set()
for data in datas:
    data_s = hashlib.md5(json.dumps(data).encode('utf-8')).hexdigest()
    if data_s not in requested_datas:
        requested_datas.add(data_s)
        res = requests.post(url)
        print(res.json())
    else:
        print('改地址请求过了， 不要再次请求')